//
//  IfBindMultipleScrollView.h
//  testDisplaylink
//
//  Created by Wang Xiahua on 15-5-27.
//  Copyright (c) 2015年 SW. All rights reserved.
//

#import <UIKit/UIKit.h>

/**
 * a view bind multiple scrollView, so they scroll just like in one scrollView
 *
 * now scrollView show from top to bottom, just like a stack view.
 * and scrollView.contentInset's top and bottom is used. so won't use it outside.
 *
 * when popup a keyboard, UIWebView will set inset, may have undefined effect.
 * and WebView's contentSize may not change smaller.
 * you can fix the incorrect contentSize by set it's contentInset to ZERO.
 */
@interface IfBindMultipleScrollView : UIView

@property (nonatomic) CGSize contentSize;

/**
 * use inset in WebView will have strange behaviour.
 * so here has a topWebView, which use contentSize instead.
 *
 * because use contentSize as space, set contentSize shouldn't use +- height
 */
@property (nonatomic, strong) UIWebView* topWebView;

/**
 * the original contentSize of webView, before expand bottom space
 *
 * You still can set contentSize topWebView.scrollView.contentSize
 *
 * when you set topWebView.scrollView.contentSize,
 * this class will automatically expand it
 * so the bottom space can place other scrollView
 */
@property (nonatomic,readonly) CGSize topWebViewOriginScrollViewSize;

- (void)addBindScrollView:(UIScrollView*)scrollView;

/** this is used for some case like WebView, where scrollView is place in a view */
- (void)addView:(UIView*)view andBindScrollView:(UIScrollView*)scrollView;

@end
